Building and registering e-mails fails with an error message
This article describes a specific issue where registering e-mails using the ContactsLaw add-in for Microsoft Outlook fails with the following error message:
Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Interop.Outlook._Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{00063001-0000-0000-C000-000000000046}' failed due to the following error: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY))
When this problem occurs, it is also not possible to create outgoing e-mails from ContactsLaw.
This issue seems to only affect a very small number of machines. It is caused by Visual Studio Tools for Office (VSTO), which identifies the wrong version of Office during installation.
The problem can be fixed, but requires manual editing of the Windows Registry. Specifically, the entries pointing to versions of Office which are not installed on the machine need to be removed.
Related issue
You may also encounter a similarly-worded error message, however the error code TYPE_E_CANTLOADLIBRARY is replaced with TYPE_E_LIBNOTREGISTERED.
This issue seems to occur after another version of Office is uninstalled.
To resolve this issue, you must uninstall all versions of Office and then reinstall the version that you intend to use with ContactsLaw. Performing a repair installation is not sufficient.
See also
0x80029C4A (TYPE_E_CANTLOADLIBRARY)